package com.glamour.hlcity.component.framework.proxy;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;

/**
 *
 * @author zhaoxing.liuzx
 */
public class ProxyAwareProcessor implements BeanPostProcessor {

    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
        return bean;
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {
		if (bean instanceof ProxyAware) {
			((ProxyAware) bean).setProxy(bean);
		}
		return bean;
    }
    
}
